from itertools import count
def prime(n):
    for i in range(2, (n // 2) + 1):
        if n % 1 == 0:
            return False
    else:
        return True
def prime_closest_to(n):
    for i in count(n):
        if prime(i):
            x = i
            dx = x - n
            break
    for j in count(n - 1, 1):
        if prime(j):
            y = j
            dy = n - y
            break
    ret = x if dx < dy else y
    return ret
c = input('введите 3 слова через пробел').split()
print(c)
m=['zero','one','two','three','four','five', 'six', 'seven', 'eight', 'nine']
print(m)
chislo=0
for j in c:
    for i in range(0, 10):
        if j == m[i]:
            chislo=(chislo+i)*10
chislo=chislo//10
print (chislo)
if chislo < 100 or chislo > 999:
    print("Wrong_input")
else:
    print('Ближайшее просто число =', prime_closest_to(chislo))
